
CC = cl
ASM = nasmw
LINK = link
RANLIB = lib.exe

BINS = wdfpkt.exe windsoul.lib
SRCS = $(wildcard *.cpp)
ASMS = $(wildcard *.asm)
OBJS = $(SRCS:.cpp=.obj)
OBJS += $(ASMS:.asm=.obj)

LIBS = ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
#copy from MSVC
OBJFLAG = /I"C:\Program Files\Microsoft DirectX SDK (August 2007)\Include" /D "WINDSOUL_STATICLIB" /D "_MSVC" /D "_LIB" /c 
LINKFLAGS = /LIBPATH:"C:\Program Files\Microsoft DirectX SDK (August 2007)\Lib\x86"
all: $(BINS)

wdfpkt.exe:wdfpkt.cpp
	$(CC) $<

windsoul.lib: $(OBJS)
	$(RANLIB) $(LINKFLAGS) /out:"$@" $(OBJS) $(LIBS)

%.obj: %.cpp
	$(CC) $(OBJFLAG) $<
%.obj: %.asm
	$(ASM) -o $@ -f win32 $<
clean:
	$(RM) -f *.obj $(BINS)